home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / sbin / update-icon-caches < prev    next >
Text File  |  2008-10-18  |  674b  |  29 lines

  1. #!/bin/sh
  2.  
  3. case "$1" in
  4.     ""|-h|--help)
  5.         echo "Usage: $0 directory [ ... ]"
  6.         exit 1
  7.         ;;
  8. esac
  9.  
  10. for dir in "$@"; do
  11.     if [ ! -d "$dir" ]; then
  12.         continue
  13.     fi
  14.     if [ -f "$dir"/index.theme ]; then
  15.         if [ -f "$dir"/icon-theme.cache ]; then
  16.             # The cache already exists, regenerate it
  17.             if ! gtk-update-icon-cache --force --quiet "$dir"; then
  18.                 echo "WARNING: icon cache generation failed for $dir"
  19.             fi
  20.         fi
  21.     else
  22.         # No more index.theme, remove the cache if it exists
  23.         rm -f "$dir"/icon-theme.cache
  24.         rmdir -p --ignore-fail-on-non-empty "$dir"
  25.     fi
  26. done
  27.  
  28. exit 0
  29.